
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DimDateMonth]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
 drop table [dbo].[DimDateMonth]

GO

CREATE TABLE [dbo].[DimDateMonth] (
	[DateMonthKey] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
	[LongName] [varchar] (30) NOT NULL,
	[ShortName] [varchar] (20) NOT NULL,
	[Year] [int] NOT NULL,
	[Month] [int] NOT NULL,
	[MonthName] nvarchar (50) NOT NULL,
	
	CONSTRAINT [PK_DateMonth] PRIMARY KEY CLUSTERED (
		   [DateMonthKey])

)

GO

grant references, select, insert, delete, update on [dbo].[DimDateMonth] to [db_datawriter]

GO

grant select on [dbo].[DimDateMonth] to [public]

GO

